package com.javase.order.parent.child;

import com.javase.order.parent.Parent;

/**
 * (业务实现)
 *
 * @author wangsh
 * @date 2018/11/21 10:13.
 */
public class Child extends Parent {
    /**
     * 静态代码块
     */
    static {
        System.out.println("Child static code block");
    }

    /**
     类代码块
     */ {
        System.out.println("Child code block");
    }

    /**
     * 构造器
     */
    public Child() {
        System.out.println("Child constructor");
    }

    @Override
    public void speak() {
        System.out.println("Child speak");
    }

    @Override
    public void speak(String str) {
        System.out.println("Child speak " + str);
    }

    public static void main(String[] args) {
        Parent test = new Child();
        test.speak("你好");
    }
}
